Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrNhatKyBanHang_TraLai
    Private Tungay, Denngay As String
    Private customerReport As ReportDocument

    Private Sub FrmCrNhatKyBanHang_2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        frmLoading.Show()
        Dim sqlQuery As String = "SELECT * FROM tbl_dot_temp_nhatky_banhang_2 as t ORDER BY ngay_chungtu, ma_chungtu"
        Dim reportPath = Application.StartupPath & "\" & "crNhatKyBanHang_TraLai.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        customerReport.SetParameterValue("ketoantruong", globalVariale.KETOANTRUONG)
        customerReport.SetParameterValue("giamdoc", globalVariale.TONGGIAMDOC)
        customerReport.SetParameterValue("company", globalVariale.COMPANY)
        customerReport.SetParameterValue("address", globalVariale.ADDRESS)
        customerReport.SetParameterValue("Tngay", Tungay)
        customerReport.SetParameterValue("Dngay", Denngay)
        'customerReport.SetParameterValue("qd1", moduleUtils.getQD("chitienmat15", 1))
        'customerReport.SetParameterValue("qd2", moduleUtils.getQD("chitienmat15", 2))
        'customerReport.SetParameterValue("qd3", moduleUtils.getQD("chitienmat15", 3))
        Me.CrNXTTongHopview.ReportSource = customerReport
        frmLoading.Close()
        frmLoading.Dispose()
    End Sub


    Public Sub setTungay(ByVal s As String)
        Tungay = s
    End Sub

    Public Sub setDenngay(ByVal s As String)
        Denngay = s
    End Sub

End Class
